<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head th:include="admin/head :: head" th:with="title=用户认证">
<body>
<div class="layuimini-container">
    <div class="layuimini-main">
        <form class="layui-form" action="" lay-filter="formfilter">
            <div class="layui-form-item">
                <label class="layui-form-label">真实实名:</label>
                <div class="layui-input-block">
                    <input type="text" th:value="${auth.realName}" readonly="readonly"  class="layui-input" >
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">身份证:</label>
                <div class="layui-input-block">
                    <input type="text" th:value="${auth.idcart}" readonly="readonly" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">正面:</label>
                <div class="layui-input-block">
                    <div th:if="${auth.image1!=null &&  auth.image1!=''}">
                        <a th:href="@{${auth.image1}}" data-lightbox="gallery" data-title="正面"><img width="100"th:src="@{${auth.image1}}"></a>
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">反面:</label>
                <div class="layui-input-block">
                    <div th:if="${auth.image2!=null &&  auth.image2!=''}">
                        <a th:href="@{${auth.image2}}" data-lightbox="gallery" data-title="正面"><img width="100"th:src="@{${auth.image2}}"></a>
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">手持:</label>
                <div class="layui-input-block">
                    <div th:if="${auth.image3!=null &&  auth.image3!=''}">
                        <a th:href="@{${auth.image3}}" data-lightbox="gallery" data-title="正面"><img width="100"th:src="@{${auth.image3}}"></a>
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">备注:</label>
                <div class="layui-input-block">
                    <input type="text" id="remark" name="remark" autocomplete="off"  class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <input type="hidden" name="id" th:value="${ auth.id}">
                    <input type="hidden" name="userId" th:value="${auth.userId}">
                    <button class="layui-btn" lay-submit="" lay-filter="formSubmit">通过</button>
                    <button class="layui-btn layui-btn-warm" lay-submit="" lay-filter="formSubmit2">拒绝</button>
                </div>
            </div>
        </form>
    </div>
</div>

<script>
    layui.use(['layedit', 'layer', 'jquery','liuQi'], function () {
        var form = layui.form,
            liuQi = layui.liuQi,
            laydate = layui.laydate;

        //日期
        form.render();

        //自定义验证规则
        form.verify({
            realName: function (value) {
            },
            idcart: function (value) {
            },
        });
        //监听提交
        form.on('submit(formSubmit)', function (data) {
            data=data.field;
            data.status=2;
            liuQi.ajax("/admin/userAuth/auth",data,
                function (data) {
                    //关闭
                    parent.layer.msg(data.msg);
                    parent.layui.table.reload('currentTableId');
                    var index = parent.layer.getFrameIndex(window.name);
                    parent.layer.close(index);
                }
            );
            return false;
        });

        form.on('submit(formSubmit2)', function (data) {
            data=data.field;
            data.status=3;
            liuQi.ajax("/admin/userAuth/auth",data,
                function (data) {
                    //关闭
                    parent.layer.msg(data.msg);
                    parent.layui.table.reload('currentTableId');
                    var index = parent.layer.getFrameIndex(window.name);
                    parent.layer.close(index);
                }
            );
            return false;
        });
    });
</script>

</body>
</html>